home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 25
/
CU Amiga Magazine's Super CD-ROM 25 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-08].iso
/
CUCD
/
WWW
/
http
/
www.cu-amiga.co.uk
/
features
/
c-tutorial
/
Part-6.lzx
/
Part-6
/
asl2
/
screen.c
< prev
next >
Wrap
C/C++ Source or Header
|
1984-05-19
|
1KB
|
48 lines
/* Open screen and setup GadTools stuff */
#include "screen.h"
#include<stdio.h>
#include<clib/intuition_protos.h>
#define MY_TITLE "Hello World Painter"
/* Global record of our screen */
struct Screen* screen = NULL;
int openScreen(int depth, int width, int height, ULONG displayid)
{
UWORD pens[] = { ~0 };
/* Try to open a new screen with requested properties */
/* (A parameter of zero will be ignored, so the default */
/* value will be used by the screen) */
if(screen = OpenScreenTags(NULL,
depth ? SA_Depth : TAG_IGNORE, depth,
width ? SA_Width : TAG_IGNORE, width,
height ? SA_Height : TAG_IGNORE, height,
displayid ? SA_DisplayID : TAG_IGNORE, displayid,
/* Enable 3D look by specifying SA_Pens */
SA_Pens, pens,
SA_Title, MY_TITLE,
TAG_DONE))
return TRUE;
else
printf("Error: could not create screen\n");
return FALSE;
}
void closeScreen()
{
if(screen)
{
CloseScreen(screen);
/* Set to NULL to indicate that it's been closed */
screen = NULL;
}
}
struct Screen* getScreen()
{
return screen;
}